package com.kgame5.xtank3d.app.gamecore.pane.tip {
import gs.TweenLite;
import gs.easing.Back;

import com.kgame5.xtank3d.C;

import flash.display.MovieClip;

/**
 * @author kk
 * 弹出提示的组件，用来提示一大波敌人来了
 */
public class GameTipComp {
	private var mc_tip:MovieClip;//其中有个textField
	
	public function GameTipComp(mc_tip:MovieClip){
		
		this.mc_tip=mc_tip;
		//mc_tip.visible=false;
		clear();
	}
	
	//显示一个飞行动画
	public function showTip(text:String):void{
		
		TweenLite.killTweensOf(mc_tip);
		mc_tip.y =C.STAGE_HEIGHT/2;
		mc_tip.visible=true;
		mc_tip.tf.text=text;
		
		TweenLite.to(mc_tip, 2, {y:C.STAGE_HEIGHT/2-60,ease:Back.easeIn,onComplete:onComplete});
	}
	
	public function clear():void{
		TweenLite.killTweensOf(mc_tip);
		mc_tip.y =C.STAGE_HEIGHT/2;
		mc_tip.visible=false;
	}
	
	private function onComplete():void{
		mc_tip.visible=false;
	}
}
}
